package com.quickcancellation.crm.utils;

import java.time.LocalDate;
import java.time.LocalDateTime;

public class DateUtils {
    /**
     * 获取当前时间
     * 格式 YYYY-MM-DD
     *
     * @return
     */
    public static String getNow() {


        return LocalDate.now().toString();
    }

    /**
     * 获取订单号码 号码格式 ORD + YYYYMMDDHHMMSSS
     * @return
     */
    public static String getOrderCode() {
        String nowStr = LocalDateTime.now()
                .toString()
                .replace("T", "")
                .replace(":", "")
                .replace("-", "")
                .replace(".","");

        return "ORD"  + nowStr;
    }

    public static void main(String[] args) {

//        LocalDateTime now = LocalDateTime.now();


//        System.out.println(DateUtils.getNow());
        System.out.println(getOrderCode());

    }
}
